package com.vhall.component.entity.dictionary.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shimingming
 * @since 2023/4/13 19:48
 */
@Getter
@AllArgsConstructor
public enum PlacementLocationEnum implements BaseEnum {

    ROTATION_CHART(0, "轮播图"),

    ;

    private Integer value;

    private String name;

    public static String getName(Integer value) {
        for (PlacementLocationEnum goodsLevelEnum : PlacementLocationEnum.values()) {
            if (goodsLevelEnum.getValue().equals(value)) {
                return goodsLevelEnum.name;
            }
        }
        return null;
    }

    public static PlacementLocationEnum parse(Integer value) {
        for (PlacementLocationEnum type : PlacementLocationEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }
}
